package org.studiox.graph.janusgraph.common;

import org.studiox.graph.common.GraphEdge;

import java.util.Objects;

public class JanusGraphEdge extends GraphEdge {

  private String id;

  private Long sourceVertexId;

  private Long targetVertexId;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public Long getSourceVertexId() {
    return sourceVertexId;
  }

  public void setSourceVertexId(Long sourceVertexId) {
    this.sourceVertexId = sourceVertexId;
  }

  public Long getTargetVertexId() {
    return targetVertexId;
  }

  public void setTargetVertexId(Long targetVertexId) {
    this.targetVertexId = targetVertexId;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    if (!super.equals(o)) {
      return false;
    }
    JanusGraphEdge that = (JanusGraphEdge) o;
    return Objects.equals(id, that.id)
        && Objects.equals(sourceVertexId, that.sourceVertexId)
        && Objects.equals(targetVertexId, that.targetVertexId);
  }

  @Override
  public int hashCode() {
    return Objects.hash(super.hashCode(), id, sourceVertexId, targetVertexId);
  }

  @Override
  public String toString() {
    return "JanusGraphEdge{"
        + "id='"
        + id
        + '\''
        + ", sourceVertexId="
        + sourceVertexId
        + ", targetVertexId="
        + targetVertexId
        + '}'
        + ",GraphEdge{"
        + super.toString()
        + "}";
  }
}
